#include "Telegram.h"
#include <cmath>

//---- Comparison operators ---- 
bool operator==(const Telegram& p_t1, const Telegram& p_t2) {
	if(fabs(p_t1.dispatchTime - p_t2.dispatchTime) < 0.25 
		&& p_t1.sender == p_t2.sender 
		&& p_t1.receiver == p_t2.receiver) {
		return true;
	}
	else {
		return false;
	}
}

bool operator<(const Telegram& p_t1, const Telegram& p_t2) {
	if(p_t1 == p_t2) {
		return false;
	}
	else {
		return p_t1.dispatchTime < p_t2.dispatchTime;
	}
}

